<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\article\ArticleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '文章列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-index">

    <p>
        <?= Html::a('添加文章', ['create'], ['class' => 'btn btn-success']) ?>
        
    </p>
    <?= $this->render('_search', ['model' => $searchModel]); ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        // 'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\CheckboxColumn'],
            // 'id',
            [
                'attribute'=>'title',
                'value'=> function ($model) {
                    return Html::a( $model->title, ['view','id'=>$model->id]);
                },
                'format'=>'html'
            ],
            'short_title',
            // 'thumb',
            'description',
            // 'content:ntext',
            // 'search_key',
            // 'channel_id',
            // 'add_time:datetime',
            // 'edit_time:datetime',
            // 'html_path',
            // 'is_hidden',
            // 'is_del',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
